package Day3;

public class ArrayDemo{

    public static void main(String[] args) {
        int size = 10;
        //定义数组
        double[] list1 = new double[size];
        list1[0] = 1;
        list1[1] = 2;
        list1[2] = 3;
        list1[3] = 4;
        double total = 0;
        for(int i=0;i<size;i++){
            total += list1[i];
        }
        System.out.println(total);
        for (double d : list1) {
            System.out.print(d+";");
        }
    }
}